-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make websocket server to send ping frame to client #459
make websocket server to send ping frame to client #459
Conversation
Thank you for the PR! Our test mocks were not prepared to handle more advanced features of the websocket mixin, but I just improved them and added a test case to make sure it works. I will merge if the CI tests pass. |
I wonder if we also need |
There is an interesting possibly pyls-related failure on Python 3.6 on Ubuntu, but not on Mac nor Win:
|
(The close/reopen is to restart the CI) |
No. I think we dont need care about pong. Web browser will automatically reply pong message, dont require developer to code about it. Browser even dont provide api for developer to send pong to server.I dont know if this is what you are worried about. |
@pytest.mark.asyncio | ||
async def test_ping(handlers): | ||
"""see https://github.com/krassowski/jupyterlab-lsp/issues/458""" | ||
a_server = "pyls" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just do not think it is needed to run this check for all language servers (just wanted to have something to pass to ws_handler.open()
) but did not want to create a mock either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, yeah, maybe we need a real pygls mock server at some point :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with bringing pygls as a mock dependency in the future.
@@ -26,6 +26,7 @@ def open(self, language_server): | |||
self.language_server = language_server | |||
self.manager.subscribe(self) | |||
self.log.debug("[{}] Opened a handler".format(self.language_server)) | |||
super().open() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good catch. might we even want to super.open
first, before any overloaded behavior?
|
||
manager.initialize() | ||
|
||
assert ws_handler.ping_interval > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests are looking good
References
try to fix #458
Code changes
User-facing changes
Backwards-incompatible changes
Chores